<?php
class UploadAction extends Action{
	function upload(){
		$this->display();
	}
	function toupload(){
		import("ORG.Net.UploadFile");
		$upload = new UploadFile(); // 实例化上传类
		$upload->maxSize = 3145728 ; // 设置附件上传大小
		$upload->allowExts = array('jpg'); // 设置附件上传类型
		$upload->savePath = './Public/image/'; // 设置附件上传目录
		$upload->uploadReplace=true;
		$upload->thumbMaxWidth='218,218';
		$upload->thumbMaxHeight ='78,78';
		$upload->saveRule='logo';
		$upload->uploadReplace=true;
		if(!$upload->upload()) { // 上传错误 提示错误信息
			$this->error($upload->getErrorMsg());
		}else{ // 上传成功 获取上传文件信息
			//$info = $upload->getUploadFileInfo();
			$this->success();
		}
	}
}